package com.example.wendao.view.ui.fragment;


import android.os.Bundle;

import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.wendao.App;
import com.example.wendao.R;
import com.example.wendao.model.entity.User;
import com.example.wendao.viewmodel.NewsViewModel;
import com.example.wendao.viewmodel.UserViewModel;

/**
 * A simple {@link Fragment} subclass.
 */

public class WatchFragment extends Fragment {
    private User user;
    private UserViewModel userViewModel;
    private NewsViewModel newsViewModel;
    private TextView textView_look;
    String content="请耐心观看";
    public WatchFragment() {}


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view= inflater.inflate(R.layout.fragment_history, container, false);
        textView_look=view.findViewById(R.id.textView_history);
        userViewModel = new ViewModelProvider(App.getInstance()).get(UserViewModel.class);
        newsViewModel = new ViewModelProvider(App.getInstance()).get(NewsViewModel.class);
        user=userViewModel.getCurrentUser();
        content=user.getAnewsId()+'\n'+user.getBnewsId();
        textView_look.setText(content);
        return view;
    }

}
